<template>
  <div>
    <h3>Test组件</h3>
    <p ref="abc">Test组件中的p标签</p>
    <!-- <input type="text" ref="abb"> -->
    <button @click="getP">获取p</button>
    <input type="text" ref="inp">
    <button @click="show">点击获取值</button>
  </div>
</template>
<script>
export default {
  methods: {
    getP() {
      const p = this.$refs.abc
      console.log(p.innerHTML)
    },
    show(){
      const input = this.$refs.inp
      console.log(input.value)
    }
  },
};
</script>
<style lang="">
</style>